import request from '@/utils/request'

// 查询日常记录-血糖记录列表
export function listGlucose(query) {
  return request({
    url: '/every/bloodGlucose/list',
    method: 'get',
    params: query
  })
}

// 查询日常记录-血糖记录详细
export function getGlucose(id) {
  return request({
    url: '/every/bloodGlucose/' + id,
    method: 'get'
  })
}

// 新增日常记录-血糖记录
export function addGlucose(data) {
  return request({
    url: '/every/bloodGlucose',
    method: 'post',
    data: data
  })
}

// 修改日常记录-血糖记录
export function updateGlucose(data) {
  return request({
    url: '/every/bloodGlucose',
    method: 'put',
    data: data
  })
}

// 删除日常记录-血糖记录
export function delGlucose(id) {
  return request({
    url: '/every/bloodGlucose/' + id,
    method: 'delete'
  })
}

// 查询app日常记录-血糖记录列表
export function appListByTime(query) {
  return request({
    url: '/every/bloodGlucose/app/list',
    method: 'get',
    params: query
  })
}


// 查询对比趋势
export function queryTrendList(query) {
  return request({
    url: '/every/bloodGlucose/app/trend/list',
    method: 'get',
    params: query
  })
}


// 正常异常数量统计
export function statisticsExce(query) {
  return request({
    url: '/every/bloodGlucose/app/statisticsExce',
    method: 'get',
    params: query
  })
}



// 查询测量类型
export function queryTypeList(query) {
  return request({
    url: '/every/bloodGlucose/targetId',
    method: 'get',
    params: query
  })
}


// 计算当前测量数据，与上一次和10天前的数据对比
export function queryDateCompare(id) {
  return request({
    url: '/every/bloodGlucose/dateCompare/' + id,
    method: 'get'
  })
}

//尿酸健康报告
export function acidReport(data) {
  return request({
    url: '/every/acid/health/report',
    method: 'post',
    data: data
  })
}

//血糖健康报告
export function bloodGlucoseReport(data) {
  return request({
    url: '/every/bloodGlucose/health/report',
    method: 'post',
    data: data
  })
}

//血压健康报告
export function bloodPressureReport(data) {
  return request({
    url: '/every/bloodPressure/health/report',
    method: 'post',
    data: data
  })
}

//血脂健康报告
export function fatReport(data) {
  return request({
    url: '/every/fat/health/report',
    method: 'post',
    data: data
  })
}

//根据sn码绑定设备
export function bindSn(data) {
  return request({
    url: '/every/bloodGlucose/bindSn',
    method: 'post',
    data: data,
    timeout: 30000 // 设备绑定需要更长时间，设置为30秒
  })
}




